package com.yan.demo.method;

public class MethodTest12 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5};
        int[] arr1 = change(arr);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }

    // 定义方法交换位置
    public static int[] change(int[] arr){
        int temp = arr[1];
        arr[1] = arr[3];
        arr[3] = temp;
        return arr;
    }
}
